home *** CD-ROM | disk | FTP | other *** search
/ PC World 2007 December / PCWorld_2007-12_cd.bin / domacnost a kancelar / autoit / autoit-v3-setup.exe / Examples / Helpfile / _GUICtrlStatusBarGetBorders.au3 < prev    next >
Text File  |  2007-09-08  |  2KB  |  48 lines

  1. Opt("MustDeclareVars", 1)
  2.  
  3. #include <GUIConstants.au3>
  4. #Include <GuiStatusBar.au3>
  5.  
  6. Local $gui, $StatusBar1, $msg
  7. Local $a_PartsRightEdge[3] = [150, 300, -1]
  8. Local $a_PartsText[3] = ["New Text", "More Text", "Even More Text"]
  9.  
  10. ;================================================================
  11. ; Example 1 - Using AutoIt Control
  12. ;================================================================
  13. $gui = GUICreate("Status Bar Get Border Widths", 500, -1, -1, -1, $WS_SIZEBOX)
  14. $StatusBar1 = _GUICtrlStatusBarCreate($gui, $a_PartsRightEdge, $a_PartsText)
  15.  
  16. Local $a_borders = _GUICtrlStatusBarGetBorders($StatusBar1)
  17. If IsArray($a_borders) Then
  18.     _GUICtrlStatusBarSetText($StatusBar1, "horizontal border: " & $a_borders[0], 0)
  19.     _GUICtrlStatusBarSetText($StatusBar1, "vertical border: " & $a_borders[1], 1)
  20.     _GUICtrlStatusBarSetText($StatusBar1, "between rectangles: " & $a_borders[2], 2)
  21. EndIf
  22.  
  23. GUISetState(@SW_SHOW)
  24.  
  25. While 1
  26.     $msg = GUIGetMsg()
  27.     Select
  28.         Case $msg = $GUI_EVENT_RESIZED
  29.             _GUICtrlStatusBarResize($StatusBar1)
  30.         Case $msg = $GUI_EVENT_CLOSE
  31.             ExitLoop
  32.         Case Else
  33.             ;;;;;
  34.     EndSelect
  35.     
  36. WEnd
  37. GUIDelete()
  38.  
  39. ;================================================================
  40. ; Example 2 - External Control
  41. ;================================================================
  42. Opt("WinTitleMatchMode", 4)
  43. Local $h_win = WinGetHandle("classname=SciTEWindow")
  44. Local $h_status = ControlGetHandle($h_win, "", "msctls_statusbar321")
  45. $a_borders = _GUICtrlStatusBarGetBorders($h_status)
  46. ConsoleWrite("horizontal border: " & $a_borders[0] & @LF & _
  47.         "vertical border: " & $a_borders[1] & @LF & _
  48.         "between rectangles: " & $a_borders[2] & @LF)